#include "CSVReader.h"

int main()
{
	CSVReader csv("example_input.csv");
	vector<csv_row> vcsv = csv.GetRowAll();

	for (int i = 0; i < csv.GetNumberOfRows(); ++i)
	{
		csv_row row = vcsv[i];
		cout<<"row "<<i<<" : "
			<<csv.GetString(row,"name1","xx")<<" "
			<<csv.GetInt(row,"name2",-5)<<" "
			<<csv.GetString(row,"name3","sdfsfsdf")<<" "
			<<csv.GetBool(row,"name4")<<" "
			<<csv.GetDouble(row,"name5",-2.0)<<" "
			<<endl;
	}

 	CSVReader reader3("example_input.csv");
 	int i = 0;
 	while (i < reader3.GetNumberOfRows())
 	{
 		cout<<reader3.GetString(i,"name1","xx")<<"\t"
 			<<reader3.GetInt(i,"name2")<<"\t"
 			<<reader3.GetString(i,"name3","xx")<<"\t"
 			<<reader3.GetBool(i,"name4")<<"\t"
 			<<reader3.GetDouble(i,"name5",-1.0)<<"\t"
 			<<endl;
 		++i;
 	}
 
 	cout<<endl<<endl;

	CSVReader reader2("example_input.csv");
	i = 0;
	while (i < reader2.GetNumberOfRows())
	{
		cout<<reader2.GetString(i,0,"xx")<<"\t"
			<<reader2.GetInt(i,1)<<"\t"
			<<reader2.GetString(i,2,"xx")<<"\t"
			<<reader2.GetBool(i,3)<<"\t"
			<<reader2.GetDouble(i,4,-1.0)<<"\t"
			<<endl;
		++i;
	}
}